home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / PIIGSIncludes / Sound.p < prev    next >
Encoding:
Text File  |  1990-04-03  |  4.1 KB  |  116 lines  |  [TEXT/MPS ]

  1. {********************************************
  2. ; File: Sound.p
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc. 1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************}
  9.  
  10. UNIT SOUND;
  11. INTERFACE
  12. USES TYPES;
  13. CONST
  14.  
  15. { Error Codes }
  16. noDOCFndErr = $0810;  { no DOC chip found }
  17. docAddrRngErr = $0811;  { DOC address range error }
  18. noSAppInitErr = $0812;  { no SAppInit call made }
  19. invalGenNumErr = $0813;  { invalid generator number }
  20. synthModeErr = $0814;  { synthesizer mode error }
  21. genBusyErr = $0815;  { generator busy error }
  22. mstrIRQNotAssgnErr = $0817;  { master IRQ not assigned }
  23. sndAlreadyStrtErr = $0818;  { sound tools already started }
  24. unclaimedSndIntErr = $08FF;  { sound tools already started }
  25.  
  26. { channelGenMode Codes }
  27. ffSynthMode = $0001;  { Free form synthesizer mode }
  28. noteSynthMode = $0002;  { Note synthesizer mode. }
  29.  
  30. { genMask Codes }
  31. gen0off = $0001;  { param to FFStopSound }
  32. gen1off = $0002;  { param to FFStopSound }
  33. gen2off = $0004;  { param to FFStopSound }
  34. gen3off = $0008;  { param to FFStopSound }
  35. gen4off = $0010;  { param to FFStopSound }
  36. gen5off = $0020;  { param to FFStopSound }
  37. gen6off = $0040;  { param to FFStopSound }
  38. gen7off = $0080;  { param to FFStopSound }
  39. gen8off = $0100;  { param to FFStopSound }
  40. gen9off = $0200;  { param to FFStopSound }
  41. gen10off = $0400;  { param to FFStopSound }
  42. gen11off = $0800;  { param to FFStopSound }
  43. gen12off = $1000;  { param to FFStopSound }
  44. gen13off = $2000;  { param to FFStopSound }
  45. gen14off = $4000;  { param to FFStopSound }
  46.  
  47. { genStatus Codes }
  48. genAvail = $0000;  { Generator available status }
  49. ffSynth = $0100;  { Free Form Synthesizer status }
  50. noteSynth = $0200;  { Note Synthesizer status }
  51. lastBlock = $8000;  { Last block of wave }
  52.  
  53. { Jump Table Offsets }
  54. smReadRegister = $00;  { Read Register routine }
  55. smWriteRegister = $04;  { Write Register routine }
  56. smReadRam = $08;  { Read Ram routine }
  57. smWriteRam = $0C;  { Write Ram routine }
  58. smReadNext = $10;  { Read Next routine }
  59. smWriteNext = $14;  { Write Next routine }
  60. smOscTable = $18;  { Pointer to Oscillator table }
  61. smGenTable = $1C;  { Pointer to generator table }
  62. smGcbAddrTable = $20;  { Pointer to GCB address table }
  63. smDisableInc = $24;  { Disable Increment routine }
  64. TYPE
  65. SoundPBHndl = ^SoundPBPtr;
  66. SoundPBPtr = ^SoundParamBlock;
  67. SoundParamBlock = RECORD
  68.     waveStart : Ptr; { starting address of wave }
  69.     waveSize : Integer; { waveform size in pages }
  70.     freqOffset : Integer; { ? formula to be provided }
  71.     docBuffer : Integer; { DOC buffer start address, low byte = 0 }
  72.     bufferSize : Integer; { DOC buffer start address, low byte = 0 }
  73.     nextWavePtr : SoundPBPtr; { Pointer to start of next wave's parameter block }
  74.     volSetting : Integer; { DOC volume setting. High byte = 0 }
  75. END;
  76. DocRegParamBlkPtr = ^DocRegParamBlk;
  77. DocRegParamBlk = PACKED RECORD
  78.     oscGenType : Integer;
  79.     freqLow1 : Byte;
  80.     freqHigh1 : Byte;
  81.     vol1 : Byte;
  82.     tablePtr1 : Byte;
  83.     control1 : Byte;
  84.     tableSize1 : Byte;
  85.     freqLow2 : Byte;
  86.     freqHigh2 : Byte;
  87.     vol2 : Byte;
  88.     tablePtr2 : Byte;
  89.     control2 : Byte;
  90.     tableSize2 : Byte;
  91. END;
  92. FUNCTION FFGeneratorStatus ( genNumber:Integer) : Integer ;
  93. PROCEDURE FFSetUpSound ( channelGen:Integer; paramBlockPtr:SoundPBPtr)  ;
  94. FUNCTION FFSoundDoneStatus ( genNumber:Integer) : Boolean ;
  95. FUNCTION FFSoundStatus  : Integer ;
  96. PROCEDURE FFStartPlaying ( genWord:Integer)  ;
  97. PROCEDURE FFStartSound ( genNumFFSynth:Integer; pBlockPtr:SoundPBPtr)  ;
  98. PROCEDURE FFStopSound ( genMask:Integer)  ;
  99. FUNCTION GetSoundVolume ( genNumber:Integer) : Integer ;
  100. FUNCTION GetTableAddress  : Ptr ;
  101. PROCEDURE ReadDOCReg (VAR pBlockPtr:DocRegParamBlk)  ;
  102. PROCEDURE ReadRamBlock ( destPtr:Ptr; docStart:Integer; byteCount:Integer)  ;
  103. PROCEDURE SetDOCReg ( pBlockPtr:DocRegParamBlk)  ;
  104. PROCEDURE SetSoundMIRQV ( sMasterIRQ:Longint)  ;
  105. PROCEDURE SetSoundVolume ( volume:Integer; genNumber:Integer)  ;
  106. FUNCTION  SetUserSoundIRQV ( userIRQVector:ProcPtr) : ProcPtr ;
  107. PROCEDURE SoundBootInit   ;
  108. PROCEDURE SoundReset   ;
  109. PROCEDURE SoundShutDown   ;
  110. PROCEDURE SoundStartUp ( dPageAddr:Integer)  ;
  111. FUNCTION SoundToolStatus  : Boolean ;
  112. FUNCTION SoundVersion  : Integer ;
  113. PROCEDURE WriteRamBlock ( srcPtr:Ptr; docStart:Integer; byteCount:Integer)  ;
  114. IMPLEMENTATION
  115. END.
  116.